﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;

namespace LogisticsWebApp
{
    public partial class PostInfo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void submit_Click(object sender, EventArgs e)
        {
            Post post = new Post
            {
               UserId=HttpContext.Current.User.Identity.Name,
               InfoType = this.infoType.SelectedValue,
               ServiceName=this.serviceName.Text,
               CategoryId=this.categoryId.SelectedValue,
               Title =this.title.Text,
               Expire=this.exipre.Text,
               Details=this.details.Text,
               IsCommercial=this.isCommercial.Checked
            };

            PostDataAccess postDA = new PostDataAccess();
            postDA.CreatePost(post);

            Server.Transfer("PostInfoResult.aspx");
        }
    }
}
